import 'package:flutter/material.dart';
import 'package:flutter_base/base/widget/base_list_more_get_builder.dart';
import 'package:flutter_base/config/app_config.dart';
import 'package:flutter_base/pages/home/model/model_test_psychology.dart';
import 'package:flutter_base/widgets/test_card/test_card_widget.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'order_list_logic.dart';

class OrderListPage extends StatelessWidget {
  const OrderListPage({super.key, required this.typeId});

  // final OrderListLogic logic = Get.put(OrderListLogic());
  final String typeId;

  @override
  Widget build(BuildContext context) {
    return BaseListMoreGetBuilder<OrderListLogic>(
      init: OrderListLogic(typeId: typeId),
      backgroundColor: Colors.transparent,
      tag: typeId,
      builder: (logic) {
        return GridView.builder(
          padding: EdgeInsets.symmetric(horizontal: 16.w),
          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: 2, // 每行两个
            mainAxisSpacing: 12.w, // 上下间距
            crossAxisSpacing: 12.w, // 左右间距
            childAspectRatio: 165 / 179.0, // item比例为165:179
          ),
          itemCount: logic.list.length,
          itemBuilder: (context, index) {
            // final model = controller.testCardList[index];
            return TestCardWidget(
              model: logic.list[index],
            );
          },
        );
      },
    );
    // return Container();
  }
}
